<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var a = 10;
        //while循环
        // while (a < 4) {
        //     console.log("执行while循环");
        // }
        // //dowhile循环
        // do {
        //     console.log("这是doWhile循环");
        // } while (a < 4)


        //列表1~10之间的所有数
        var index1 = 1
        while(index1<10){
            console.log("while循环"+index1);
            index1++
        }

        var index2 = 1;
        do{
            console.log("doWhile循环"+index2);
            index2++
        }while(index2<10)
    </script>
</body>

</html>